package jsyf.oa.entity.wreport;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @author: @张巨波 @zhangjubo
 * @creat: on 2017/12/1.
 * @since: V1.0.0
 * @see jsyf.oa.web
 */

@Entity
@Table(name = "T_WRT_EXPENSES", schema = "oa", catalog = "")
public class WReportExpensesEntity extends BaseEntity implements Serializable {
    private Integer id;
    private String name;
    private Integer parentId;
    private String phoneName;
    private Integer temporaryCost;

//   // public Integer getId() {
//        return id;
//    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getPhoneName() {
        return phoneName;
    }

    public void setPhoneName(String phoneName) {
        this.phoneName = phoneName;
    }

    public Integer getTemporaryCost() {
        return temporaryCost;
    }

    public void setTemporaryCost(Integer temporaryCost) {
        this.temporaryCost = temporaryCost;
    }

    public JSONObject getJSONObject(){
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("NAME", this.getName());
        obj.put("PARENT_ID",this.getParentId());
        obj.put("PHONE_NAME",this.getPhoneName());
        obj.put("TEMPORARY_COST",this.getTemporaryCost());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_WRT_EXPENSES";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("NAME" ,"name");
        obj.put("PARENT_ID","parentId");
        obj.put("PHONE_NAME","phoneName");
        obj.put("TEMPORARY_COST","temporaryCost");
        return obj;
    }
}
